<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopOrderActivityShopJoinRelTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_order_activity_shop_join_rel', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("shopOrderActivityId")->comment("门店订货活动ID")->default(0);
            $table->unsignedBigInteger("shopId")->comment("门店id")->default(0);
            $table->unsignedTinyInteger("status")->comment("参与状态")->default(0);

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1是');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '门店订货活动 - 门店参与记录表';

            $table->index(['shopOrderActivityId', 'shopId'], 'idx_shopOrderActivityId_shopId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_order_activity_shop_join_rel');
    }
}
